-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tetragon:1.1: resolve uid to username for exec events from /proc fs #2603
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
tixxdz
commented
Jun 24, 2024
[Upstream main d2b5c6a ] [Includes username fix Upstream main 96e5028 ] Cache UIDs/Usernames so we reduce: - I/O on /etc/passwd for each execution especially for root user and other system user IDs as by default lot of software runs under those. - Some users may watch /etc/passwd access, so caching those entries will reduce Tetragon generated events and improve performance overall. We only cache UIDs from 0..999 as these are considered standard system users, that are set by most distros packages. Distros maintainers usually do great job to not clash such users. For anything above > 999 we do not cache it, we can that if users want such support later. Reference: https://github.com/systemd/systemd/blob/main/docs/UIDS-GIDS.md#summary Signed-off-by: Djalal Harouni <[email protected]>
[ Upstream main dac9959 ] Signed-off-by: Djalal Harouni <[email protected]>
Right now we resolve uid->username only for processes that start after tetragon. To also handle the ones that start before, we need to resolve the username during /proc fs scanning. This patch adds userinfo module part of sensors/exec and call it for both bpf exec sensors and proc_reader procfs scanning. We keep same semantics if a process is not in mount and user host namespaces we do not resolve its username. Signed-off-by: Djalal Harouni <[email protected]>
Signed-off-by: Djalal Harouni <[email protected]>
Signed-off-by: Djalal Harouni <[email protected]>
tixxdz
added
the
release-note/minor
This PR introduces a minor user-visible change
label
Jun 24, 2024
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
tixxdz
changed the title
tetragon:1.1: resolve uid to username for exec events from /proc fs #2588
tetragon:1.1: resolve uid to username for exec events from /proc fs
Jun 24, 2024
Add two metrics: - process_metadata_username_ignored_not_in_host_namespaces: This is to note that we did not perform uid->username resolution and it was ignored due the target process not being in mount or user host namespaces. - process_metadata_username_failed: that is to note that we did try to resolve target process uid->username but it failed for some reasons. Signed-off-by: Djalal Harouni <[email protected]>
tixxdz
force-pushed
the
pr/tixxdz/backports-1.1-username-from-procfs
branch
from
June 24, 2024 20:52
745f46b
to
ff514d1
Compare
kkourt
approved these changes
Jun 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.